package action.UserAction;

import model.dao.UserDao;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

import domain.UserInfo;

public class Update_UserPwd extends ActionSupport {
	String oldPwd;
	String newPwd;
	String newRePwd;

	public String getNewPwd() {
		return newPwd;
	}

	public void setNewPwd(String newPwd) {
		this.newPwd = newPwd;
	}

	public String getNewRePwd() {
		return newRePwd;
	}

	public void setNewRePwd(String newRePwd) {
		this.newRePwd = newRePwd;
	}

	public String getOldPwd() {
		return oldPwd;
	}

	public void setOldPwd(String oldPwd) {
		this.oldPwd = oldPwd;
	}

	public String updatePwd() throws Exception {
		UserInfo users = (UserInfo) ServletActionContext.getRequest()
				.getSession().getAttribute("UserLogin");
		UserDao userdao = new UserDao();
		userdao.UpdatePwd(users.getUserName(), oldPwd,newPwd);
		return SUCCESS;
	}
	
}
